#include<iostream>
#include<string>

using namespace std;

class Operation
{
public:
	Operation(){}
	virtual ~Operation(){}

	void SetNum(double A,double B)
	{
		NumA=A;
		NumB=B;
	}

	double GetNumA()
	{
		return NumA;
	}

	double GetNumB()
	{
		return NumB;
	}

	virtual double Result()
	{


		return 0;
	}

private:
	double NumA;
	double NumB;
};

class Add:public Operation

{
public:
	Add(){}
	~Add(){}

	double Result()
	{
		return (GetNumA()+GetNumB());
	}

};

class Sub:public Operation

{
public:
	Sub(){}
	~Sub(){}

	double Result()
	{
		return (GetNumA()-GetNumB());
	}

};

================================================

#include "Head.h"

int main(void)
{
	cout<<"The simple_factory model"<<endl;

	char ch;
	double A=10;
	double B=20;
	scanf("%c",&ch);
	Operation * Oper=NULL;

	switch (ch)
	{
	case '+':
		Oper=new Add;
		break;
	case '-':
		Oper=new Sub;
		break;
	}

	Oper->SetNum(A,B);

	cout<<Oper->Result()<<endl;


	return 0;
}
